#!/usr/bin/env python
# -*- coding:utf-8 -*-

from flask_restful import Api

from . import commentinfo_blueprint
from api_1_0.commentInfoResource.commentInfoResource import CommentInfoResource
from api_1_0.commentInfoResource.commentInfoOtherResource import CommentInfoOtherResource

api = Api(commentinfo_blueprint)

api.add_resource(CommentInfoResource, '/commentInfo/<AutoID>', '/commentInfo', endpoint='commentInfo')


# joint query
@commentinfo_blueprint.route('/commentInfo/query', methods=['GET'], endpoint='commentInfo_query')
def CommentInfo_query():
    return CommentInfoOtherResource.joint_query()

@commentinfo_blueprint.route('/commentInfo/getallcomment', methods=['GET'], endpoint='commentInfo_getallcomment')
def CommentInfo_getallcomment():
    return CommentInfoOtherResource.getallcomment()

@commentinfo_blueprint.route('/commentInfo/addcomment', methods=['POST'], endpoint='commentInfo_addcomment')
def CommentInfo_addcomment():
    return CommentInfoOtherResource.addcomment()

# 消息通知文章被评论，评论被回复，点赞消息
@commentinfo_blueprint.route('/commentInfo/messageinform', methods=['GET'], endpoint='commentInfo_messageinform')
def CommentInfo_messageinform():
    return CommentInfoOtherResource.messageinform()